home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / joinnewgroup.thor < prev    next >
Text File  |  1998-05-24  |  2KB  |  61 lines

  1. /*
  2. $VER: JoinNewGroup.thor 1.1 (21.06.96)
  3. (c)  Neil Bothwick <neil@wirenet.co.uk> 1996
  4. */
  5.  
  6. /* Presents the contents of a NewGroups message in a    */
  7. /* listview and creates join events for those selected  */
  8.  
  9. options results
  10.  
  11. /* needs THOR and bbsread.library functions */
  12.  
  13. thorport = address()
  14. if left(thorport,5) ~= 'THOR.' then do
  15.     say 'No THOR port found. This script must be run from Thor.'
  16.     exit 10
  17.     end
  18.  
  19. if ~show('p', 'BBSREAD') then do
  20.     address command
  21.     'run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead'
  22.     'WaitForPort BBSREAD'
  23.     end
  24.  
  25. address(thorport)
  26. drop MSG.
  27. CURRENTMSG stem MSG                                         /* Get info on current message */
  28. if rc ~= 0 then ExitMsg(THOR.LASTERROR)
  29. if upper(MSG.CONFNAME) ~= 'INFORMATION' then ExitMsg('This script only works from the Information conference')
  30.  
  31. address(bbsread)                                            /* Read list of new newsgroups */
  32. drop TEXT.
  33. READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR textstem TEXT
  34.  
  35. address(thorport)
  36. drop PICKED.
  37. REQUESTLIST instem TEXT.TEXT outstem PICKED                 /* Show new groups in a listview */
  38.  
  39. if RC = 5 then ExitMsg('No newsgroup selected')
  40. if RC > 0 then ExitMsg(THOR.LASTERROR)
  41.  
  42. NewGroup = RESULT
  43.  
  44. address(bbsread)
  45. drop NEWEVENT.                                              /* Create join event */
  46. NEWEVENT.CONFERENCE = NewGroup
  47. WRITEBREVENT bbsname '"'MSG.BBSNAME'"' event 2 stem NEWEVENT
  48. if rc ~= 0 then ExitMsg(BBSREAD.LASTERROR)
  49.  
  50. address(thorport)
  51. REQUESTNOTIFY '"'NewGroup' joined"' '"OK"'
  52.  
  53. exit
  54.  
  55. ExitMsg:
  56.     address(thorport)
  57.     parse arg errmsg
  58.     REQUESTNOTIFY '"'errmsg'"' '" OK "'
  59.     exit
  60.  
  61.